package cn.codeforfun;

import cn.codeforfun.modules.main.MainController;
import cn.codeforfun.shared.LookAndFeelUtils;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

import javax.swing.*;

@SpringBootApplication
public class DemoSwing2Application {

    public static void main(String[] args) {
        LookAndFeelUtils.setWindowsLookAndFeel();
        ConfigurableApplicationContext context = new SpringApplicationBuilder(DemoSwing2Application.class)
                .headless(false).run(args);
        SwingUtilities.invokeLater(() -> {
            MainController mainMenuController = context.getBean(MainController.class);
            mainMenuController.prepareAndOpenFrame();
        });
    }

}
